<!--
 * @Description: ...
 * @Author: yangli 121029539@qq.com
 * @Date: 2025-02-06 11:23:56
 * @LastEditTime: 2025-02-19 14:37:26
 * @LastEditors: yangli 121029539@qq.com
 * @FilePath: \uniapp\src\pagesrepair\expressdetail.vue
-->
<template>
    <view class="bg-white min-h-screen ">
        <view class="h-[10px] bg-page "></view>
        <view class="flex flex-row text-base justify-between p-[20rpx] border-solid border-0 border-b border-[#eee]">
            <view class="text-main">韵达快递NO.15645641561
            </view>
            <view @click="copy('15645641561')" class="text-blue">复制
            </view>
        </view>
        <view class="py-[46rpx] px-[40rpx]">
            <template v-for="(item, index) in state.dataList" :key="index">
                <zh-logistics-item :logistics-data="item">
                    <template v-if="item.status != 0" #node="{ data }">
                        <image v-if="data.status == '7'" style="width:80rpx;" src="/static/images/repair/repair3.png"
                            mode="widthFix"></image>
                        <image v-if="data.status == '1'" style="width:48rpx;height: 48rpx"
                            src="/static/images/repair/icon_express.png" mode="widthFix"></image>
                    </template>
                </zh-logistics-item>
            </template>
        </view>
    </view>
</template>

<script setup lang="ts">
import { expressDetail } from '@/api/repair'
import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app";
import { computed, reactive, ref, shallowRef } from 'vue'
import { useAppStore } from '@/stores/app'
import { useUserStore } from '@/stores/user'
import zhLogisticsItem from "@/components/zh-logistics-item/zh-logistics-item.vue";
import { useCopy } from '@/hooks/useCopy'
// 使用 useCopy 工具函数
const { copy } = useCopy();

const appStore = useAppStore()
const userStore = useUserStore()
const token = computed(() => userStore.token)
const pageNo = ref()
const state = reactive({
    pageData: {

    },
    dataList: [
        {
            info: '派送成功',
            status: 7,
            statusLabel: "已签收",
            time: '2021-11-11 17:42'
        },
        {
            info: '[代收点] 您的快件已从XXX顺丰速运代理店取出〖来自代收点〗',
            status: 0,
            time: '2021-11-11 17:31'
        },
        {
            info: '快件领取成功',
            status: 0,
            time: '2021-11-11 17:31'
        },
        {
            info: '[代收点] 您的顺丰速运包裹已由XXX顺丰速运代理店代收，代收点地址：XXX， ： 〖来自代收点〗',
            status: 6,
            statusLabel: "代取件",
            time: '2021-11-11 17:15'
        },
        {
            info: '快件交给XXX，正在派送途中（：，顺丰已开启“安全呼叫”保护您的电话隐私，请放心接听！）（主单总件数：1件）',
            status: 5,
            statusLabel: "派送中",
            time: '2021-11-11 17:07'
        },
        {
            info: '快件到达〖XXX合作点〗',
            status: 4,
            statusLabel: "运输中",
            time: '2021-11-11 16:25'
        },
        {
            info: '快件在〖XXX营业点〗完成分拣，准备发往〖XXX合作点〗',
            status: 0,
            time: '2021-11-11 13:50'
        },
        {
            info: '快件到达〖XXX营业点〗',
            status: 0,
            time: '2021-11-11 13:06'
        },
        {
            info: '快件到达〖XXX转场〗',
            status: 0,
            time: '2021-11-11 05:36'
        },
        {
            info: '顺丰速运已收取快件',
            status: 3,
            statusLabel: "已揽件",
            time: '2021-11-10 21:54'
        },
        {
            info: '包裹正在等待揽收',
            status: 2,
            statusLabel: "已发货",
            time: '2021-11-10 17:41'
        },
        {
            info: '商品已经下单',
            status: 1,
            statusLabel: "已下单",
            time: '2021-11-10 12:17'
        }
    ]
})
// 请求物流信息
const init = async () => {
    // const data = await getDeptTreeList()
    // state.page_list = data;
}
function onCopy() {
    uni.setClipboardData({
        data: 'NO.15645641561',
        success: function () {
            uni.showToast({
                title: '复制成功'
            });
        }
    });
}

onLoad((options: any) => {
    pageNo.value = options?.no
    // 
})

</script>

<style lang="scss" scoped></style>
